package group.sicher.common.entity;

import group.sicher.common.constant.senum.CouponUsingStatusEnum;

import javax.persistence.*;
import java.util.Objects;

/**
 * @Auth rock
 * @Date 2019/7/1 21:08
 * @description
 */
@Entity
@Table(name = "wm_shop_coupon_accept")
public class ShopCouponAcceptEntity {

    private Long id;
    private Long shopId;
    private Long consumerId;
    private Long couponId;
    private String mobile;
    private CouponUsingStatusEnum status;
    private Long createAt;
    private Long useAt;

       @Id
   @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Column(name = "id", nullable = false)
    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    @Basic
    @Column(name = "shop_id", nullable = true)
    public Long getShopId() {
        return shopId;
    }

    public void setShopId(Long shopId) {
        this.shopId = shopId;
    }

    @Basic
    @Column(name = "consumer_id", nullable = true)
    public Long getConsumerId() {
        return consumerId;
    }

    public void setConsumerId(Long consumerId) {
        this.consumerId = consumerId;
    }

    @Basic
    @Column(name = "coupon_id", nullable = true, length = 50)
    public Long getCouponId() {
        return couponId;
    }

    public void setCouponId(Long couponId) {
        this.couponId = couponId;
    }

    @Basic
    @Column(name = "mobile", nullable = true, length = 20)
    public String getMobile() {
        return mobile;
    }

    public void setMobile(String mobile) {
        this.mobile = mobile;
    }

    @Basic
    @Column(name = "status", nullable = false)
    public CouponUsingStatusEnum getStatus() {
        return status;
    }

    public void setStatus(CouponUsingStatusEnum status) {
        this.status = status;
    }

    @Basic
    @Column(name = "create_at", nullable = true)
    public Long getCreateAt() {
        return createAt;
    }

    public void setCreateAt(Long createAt) {
        this.createAt = createAt;
    }

    @Basic
    @Column(name = "use_at", nullable = true)
    public Long getUseAt() {
        return useAt;
    }

    public void setUseAt(Long useAt) {
        this.useAt = useAt;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        ShopCouponAcceptEntity that = (ShopCouponAcceptEntity) o;
        return id == that.id &&
                status == that.status &&
                Objects.equals(shopId, that.shopId) &&
                Objects.equals(consumerId, that.consumerId) &&
                Objects.equals(couponId, that.couponId) &&
                Objects.equals(mobile, that.mobile) &&
                Objects.equals(createAt, that.createAt) &&
                Objects.equals(useAt, that.useAt);
    }

    @Override
    public int hashCode() {
        return Objects.hash(id, shopId, consumerId, couponId, mobile, status, createAt, useAt);
    }
}
